import request from '@/utils/request'

// 获取用户绑定的银行卡
export const findBank = () => {
  return request({
    url: '/service-bank/airui/api/bank/findBank',
    method: 'get',
  })
}

// 获取当前银行卡活期余额
export const findPrice = params => {
  return request({
    url: '/service-bank/airui/api/deposit/findByBankCard?bankCard=' + params,
    method: 'get',
  })
}

// 获取当前银行卡定期期余额
export const findFxiedPrice = params => {
  return request({
    url: '/service-bank/airui/api/deposit/findFixed?bankCard=' + params,
    method: 'get',
  })
}
//获取定期日期
export const findDate = () => {
  return request({
    url: '/service-bank/airui/api/depositType/findByDepositType',
    method: 'get',
  })
}
/**
 * 充值
 */

export const  rechargePrice = (bankCard, price) => {
  return request({
    url: '/service-bank/airui/api/bank/savePrice?bankCard=' +bankCard +'&price='+price,
    method: 'post',
  })
}

//确认活期转定期申请
export const apply = (bankCard, price, did, payPassword) => {
  return request({
    url:
      '/service-bank/airui/api/deposit/confirm?bankCard=' +
      bankCard +
      '&price=' +
      price +
      '&did=' +
      did +
      '&payPassword=' +
      payPassword,
    method: 'post',
  })
}

//确认定期转活期申请
export const appFxied = (bankCard, price, id, payPassword) => {
  return request({
    url:
      '/service-bank/airui/api/deposit/confirmFixed?bankCard=' +
      bankCard +
      '&price=' +
      price +
      '&depositid=' +
      id +
      '&payPassword=' +
      payPassword,
    method: 'post',
  })
}
